<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MODULE_IMAGE:  Fichier source de /home/radius/Documents/Rachid_Licence/LIF7/LIF7_TD1/module-image/src/mainExemple.c</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Généré par Doxygen 1.6.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Page&nbsp;principale</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Fichiers</span></a></li>
      <li><a href="dirs.html"><span>Répertoires</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>Liste&nbsp;des&nbsp;fichiers</span></a></li>
      <li><a href="globals.html"><span>Membres&nbsp;de&nbsp;fichier</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="dir_53790bda95882cd03745840c1cece42e.html">src</a>
  </div>
</div>
<div class="contents">
<h1>mainExemple.c</h1><a href="main_exemple_8c.html">Aller à la documentation de ce fichier.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
<a name="l00002"></a>00002 <span class="preprocessor">#include &quot;<a class="code" href="_image_8h.html" title="Fichier d&amp;#39;entête du module Image.">Image.h</a>&quot;</span>
<a name="l00003"></a>00003 <span class="preprocessor">#include &quot;<a class="code" href="_pixel_8h.html" title="Fichier d&amp;#39;entête du module Pixel.">Pixel.h</a>&quot;</span>
<a name="l00004"></a>00004 
<a name="l00005"></a><a class="code" href="main_exemple_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">00005</a> <span class="keywordtype">int</span> <a class="code" href="main_exemple_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>()
<a name="l00006"></a>00006 {
<a name="l00007"></a>00007     <a class="code" href="structs_image.html" title="Structure utilisée pour la gestion d&amp;#39;une image.">Image</a> im, imb;
<a name="l00008"></a>00008     <a class="code" href="struct_pixel.html" title="Structure utilisée pour la gestion d&amp;#39;une image.">Pixel</a> color = { 255, 128, 0 };
<a name="l00009"></a>00009     <a class="code" href="struct_pixel.html" title="Structure utilisée pour la gestion d&amp;#39;une image.">Pixel</a> color2 = { 255, 128, 255 };
<a name="l00010"></a>00010     <a class="code" href="struct_pixel.html" title="Structure utilisée pour la gestion d&amp;#39;une image.">Pixel</a> color3 = { 0, 128, 255 };
<a name="l00011"></a>00011 
<a name="l00012"></a>00012 
<a name="l00013"></a>00013     <a class="code" href="_image_8c.html#a6edbdf3bfe3beb4e44246a6c7985055c" title="Initialise une image.">imInit</a>(&amp;im, 64, 48);
<a name="l00014"></a>00014     <a class="code" href="_image_8c.html#aa04f50f4353fee39ec6cfd7201ab0367" title="Efface l&amp;#39;image en appelant imDessineRectangle avec le bon rectangle.">imEffacer</a>(&amp;im, &amp;color);
<a name="l00015"></a>00015     <a class="code" href="_image_8c.html#aae7e2d32a1d4c4516a818d8a473c0a86" title="Dessine un rectangle de couleur dans l&amp;#39;image en utilisant setPix.">imDessineRectangle</a>( &amp;im, 10, 5, 25, 10, &amp;color2);
<a name="l00016"></a>00016     <a class="code" href="_image_8c.html#ad239628e88372f488e18848112517521" title="Modifie le pixel de coordonnée (x,y).">setPix</a>(&amp;im, 2, 2, &amp;color2);            <span class="comment">/* change le pixel (2,2) */</span>
<a name="l00017"></a>00017     <a class="code" href="_image_8c.html#a20b9ad35b6db7bd09d7452574d04dd50" title="sauvegarde une image au format .ppm.">imSauver</a>(&amp;im, <span class="stringliteral">&quot;toto.ppm&quot;</span>);
<a name="l00018"></a>00018 
<a name="l00019"></a>00019 
<a name="l00020"></a>00020     <a class="code" href="_image_8c.html#a0a1f0b9be4b910e1cfc2648cfa9e38fd" title="Ouvre une image au format .ppm.">imOuvrir</a>( &amp;imb, <span class="stringliteral">&quot;toto.ppm&quot;</span>);
<a name="l00021"></a>00021     <a class="code" href="_image_8c.html#aae7e2d32a1d4c4516a818d8a473c0a86" title="Dessine un rectangle de couleur dans l&amp;#39;image en utilisant setPix.">imDessineRectangle</a>( &amp;imb, 5, 5, 15, 10, &amp;color3);
<a name="l00022"></a>00022     <a class="code" href="_image_8c.html#aae7e2d32a1d4c4516a818d8a473c0a86" title="Dessine un rectangle de couleur dans l&amp;#39;image en utilisant setPix.">imDessineRectangle</a>( &amp;imb, 25, 25, 35, 45, &amp;color3);
<a name="l00023"></a>00023     <a class="code" href="_image_8c.html#a20b9ad35b6db7bd09d7452574d04dd50" title="sauvegarde une image au format .ppm.">imSauver</a>( &amp;imb, <span class="stringliteral">&quot;titi.ppm&quot;</span>);
<a name="l00024"></a>00024 
<a name="l00025"></a>00025     <a class="code" href="_image_8c.html#a5931290abc22d365ae351381c594613f" title="Libère une image de la mémoire.">imLibere</a>(&amp;im);
<a name="l00026"></a>00026     <a class="code" href="_image_8c.html#a5931290abc22d365ae351381c594613f" title="Libère une image de la mémoire.">imLibere</a>(&amp;imb);
<a name="l00027"></a>00027     <span class="keywordflow">return</span> 0;
<a name="l00028"></a>00028 }
</pre></div></div>
<hr size="1"/><address style="text-align: right;"><small>Généré le Fri Oct 21 20:06:53 2011 pour MODULE_IMAGE par&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>
